package chapterfour;

/**
 * Created by Think on 2016/3/18.
 * 可以让用户输入整数，输入0后会计算所有整数总和并显示
 */
import java.util.Scanner;
public class Sum {
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
        long sum=0;
        long number=0;
        do{
            System.out.printf("输入整数：");
            number=Long.parseLong(scanner.nextLine());
            sum+=number;
        }while(number!=0);
        System.out.println("总和："+sum);
    }
}
